﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<div class="modal-dialog x-modal-dialog" style="width: 650px; margin-top: 100px;">

  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
      </button>
      <h4 class="modal-title">Date&nbsp;-&nbsp;Edit</h4>
    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/sessions/${sessionId}/orientations/${sessionMeeting.id}/edit-date" data-validate="true">

      <input type="hidden" name="_method" value="PATCH" />
      <input type="hidden" name="meetingId" value="${sessionMeeting.id}" />
      
      <fmt:formatDate var="startTime" value='${sessionMeeting.startTime}' pattern='yyyy-MM-dd HH:mm'/>
      <fmt:formatDate var="endTime" value='${sessionMeeting.endTime}' pattern='yyyy-MM-dd HH:mm'/>

      <div class="modal-body">

        <div class="form-group x-form-group payment-type">
          <label class="col-xs-4 control-label">Start Date</label>
          <div class="col-xs-6 pull-left">
            <input type="text" class="form-control minute" name="startTime" value="${startTime}" data-validate="required" placeholder="Start Date" readOnly/>
          </div>
        </div>
        
        <div class="form-group x-form-group payment-type">
          <label class="col-xs-4 control-label">End Date</label>
          <div class="col-xs-6 pull-left">
            <input type="text" class="form-control minute" name="endTime" value="${endTime}" data-validate="required" placeholder="End Date" readOnly/>
          </div>
        </div>

      </div>
      
      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
      
    </form>
  </div>
</div>

<script>
  $('.minute').datetimepicker({
    format: 'yyyy-mm-dd HH:ii',
    minView: 0,
    autoclose: true,
    language: 'zh-CN',
    todayBtn: 'linked',
    startDate: '${today}',
    todayHighlight: true,
    pickerPosition: 'bottom-right'
   });
</script>